<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<style>
    .active{
        font-size: 50px;
        color:red;
    }
</style>
<body>
    <div id="demo">
        <div :class="{active : isActive}">Hello,World</div>
        <div>
            <button v-on:click="clickRed">点击变红</button>
            <button v-on:click="clickRemake">点击恢复</button>

        </div>
    </div>
    <script>
        var vm=new Vue({
            el:'#demo',
            data:{
                isActive:false
            },
            methods:{
                clickRed:function(){
                    this.isActive=true;
                },
                clickRemake:function(){
                    this.isActive=false;
                }
            }
        });
    </script>
</body>
</html>